<html><head><title>LISP Interpreter Applet</title></head><body>
<h1>
LISP interpreter for 
<i>The Limits of Mathematics, The Unknowable, Exploring RANDOMNESS</i>
</h1>
<b>JDK1.1.2 VERSION</b>
<p>
[This Java applet version of my LISP
is identical with the ``official''
<a href="http://www.cs.auckland.ac.nz/CDMTCS/chaitin/unknowable/lisp.c">C</a> and 
<a href="http://www.cs.auckland.ac.nz/CDMTCS/chaitin/unknowable/lisp.m">Mathematica</a> versions,  
except that it allows several M-exps per line, and 
in its normal non-echo mode
M-exp input is not interspersed with the S-exp output.
It will run all the LISP code in 
<a href="http://www.cs.auckland.ac.nz/CDMTCS/chaitin/ait/index.html"><i>Exploring RANDOMNESS</i></a>,
<a href="http://www.cs.auckland.ac.nz/CDMTCS/chaitin/unknowable/index.html"><i>The Unknowable</i></a> and
<a href="http://www.cs.auckland.ac.nz/CDMTCS/chaitin/lm.html"><i>The Limits of Mathematics</i></a>. 
Just cut and paste entire LISP .l source code files
into the upper window, the M-exp input area, and click on run.
The output will appear in the bottom window.]
</p><p>
For a tutorial on this LISP, see <a href="http://www.cs.auckland.ac.nz/CDMTCS/chaitin/unknowable/ch2.html">this chapter</a>
of <i>The Unknowable</i>, or <a href="http://www.cs.auckland.ac.nz/CDMTCS/chaitin/ait2.html">this chapter</a> of <i>Exploring RANDOMNESS</i>.
For a summary, see below.  For the Java code for the interpreter, 
click <a href="http://www.cs.auckland.ac.nz/CDMTCS/chaitin/unknowable/lisp.java">here</a> and <a href="http://www.cs.auckland.ac.nz/CDMTCS/chaitin/unknowable/Sexp.java">here</a>.
</p><p>
<a style="border-width: 0px; margin: 0px; padding: 0px; outline-offset: -1px; display: inline;" title="&lt;APPLET&gt;, java-vm@http://www.cs.auckland.ac.nz/CDMTCS/chaitin/unknowable/lisp.class" class="__noscriptPlaceholder__" href="http://www.cs.auckland.ac.nz/CDMTCS/chaitin/unknowable/lisp.class" id=""><div style="border: 0px none rgb(0, 0, 0); margin: 0px; padding: 0px; overflow: visible; background-attachment: scroll; background-color: transparent; background-image: none; background-repeat: repeat; border-collapse: separate; border-spacing: 0px; bottom: auto; caption-side: top; clear: none; clip: rect(auto, auto, auto, auto); color: rgb(0, 0, 0); counter-increment: none; counter-reset: none; cursor: auto; direction: ltr; display: block; empty-cells: -moz-show-background; float: none; font-family: serif; font-size: 16px; font-size-adjust: none; font-style: normal; font-variant: normal; font-weight: 400; height: 350px; left: auto; letter-spacing: normal; line-height: normal; list-style-image: none; list-style-position: outside; list-style-type: disc; max-height: none; max-width: none; min-height: 32px; min-width: 32px; outline-color: rgb(0, 0, 0); outline-style: none; outline-width: 0px; outline-offset: 0px; position: static; right: auto; table-layout: auto; text-align: start; text-decoration: none; text-indent: 0px; text-transform: none; top: auto; unicode-bidi: normal; vertical-align: 0px; visibility: visible; white-space: normal; width: 700px; word-spacing: normal; z-index: auto; -moz-appearance: none; -moz-background-clip: border; -moz-background-inline-policy: continuous; -moz-background-origin: padding; -moz-binding: none; -moz-border-bottom-colors: none; -moz-border-left-colors: none; -moz-border-right-colors: none; -moz-border-top-colors: none; -moz-border-radius-bottomleft: 0px; -moz-border-radius-bottomright: 0px; -moz-border-radius-topleft: 0px; -moz-border-radius-topright: 0px; -moz-box-align: stretch; -moz-box-direction: normal; -moz-box-flex: 0; -moz-box-ordinal-group: 1; -moz-box-orient: horizontal; -moz-box-pack: start; -moz-box-sizing: content-box; -moz-column-count: auto; -moz-column-width: auto; -moz-column-gap: 0px; -moz-float-edge: content-box; -moz-image-region: rect(auto, auto, auto, auto); opacity: 1; -moz-outline-radius-bottomleft: 0px; -moz-outline-radius-bottomright: 0px; -moz-outline-radius-topleft: 0px; -moz-outline-radius-topright: 0px; -moz-user-focus: none; -moz-user-input: auto; -moz-user-modify: read-only;"></div></a>
</p><p>
<b>Example:</b>
To define factorial, run "define (f n) if = display n 0 1 * n (f - n 1)".
To try it, run "(f 5)".  
Use cut and paste to enter this without typing it.
</p><p>
<b>Syntax:</b> empty list nil = (), 
lists &amp; sublists built up from atoms which are names and unsigned integers.
Token delimiter characters are blank, single-quote, double-quote, parens,
and square brackets.
A double-quote is used to include an S-exp within an M-exp.
Square brackets enclose comments, [like this], 
and comments may be nested.
</p><p>
<b>Functional notation:</b> (f x y z) is f(x,y,z).  In M-exps parens for primitive
functions are omitted, in S-exps all parens are given explicitly.
Defined functions are of the form (lambda (parameter-list) function-body). 
</p><p>
<b>List-processing functions:</b> 
<i>car</i> (one argument, first element of list), 
<i>cdr</i> (one arg, rest of list),
<i>cons</i> (two args, add new element to beginning of list), 
<i>atom</i> (one argument, is-atom predicate),
= (two args, equal S-exp predicate), 
<i>append</i> (two args, combines two lists), 
<i>length</i> (one arg, number of elements in list), 
<i>size</i> (one arg, number of characters in S-exp), 
<i>cadr</i> (one arg, second element of list), 
<i>caddr</i> (one arg, third element of list). 
</p><p>
<b>Pseudo-functions:</b>
' (one argument, quote, literally), 
" (one argument, S-exp within M-exp), 
<i>if</i> (three args, if-then-else selector function),
<i>display</i> (one arg, identity function, shows arg),
<i>let</i> (three args, let-be-in, temporary definition), 
<i>define</i> (two args, define-to-be, permanent definition&#8212;allowed at top level only),
<i>eval</i> (one arg, evaluate S-exp in std environment), 
<i>lambda</i> (two args, associates list of parameters with function body).
</p><p>
<b>Arithmetic functions:</b> 
+ (two args, addition), - (two args, subtraction), * (two args, multiplication), 
^ (two args, exponentiation),
&lt; (two args, less-than predicate), &gt; (two args, greater-than predicate), 
&lt;= (two args, less-than-or-equal predicate),
&gt;= (two args, greater-than-or-equal predicate), = (two args, equality predicate),
<i>base2-to-10</i> (one arg, converts list of bits to integer),
<i>base10-to-2</i> (one arg, converts integer to list of bits).
</p><p>
<b>Advanced functions:</b>
(For detailed explanations, see my book 
<a href="http://www.cs.auckland.ac.nz/CDMTCS/chaitin/lm.html">
<i>The Limits of Mathematics</i></a><i>.</i>)
<i>try</i> (three args, try within time-limit to evaluate S-exp with given binary data),
<i>debug</i> (one arg, identity function, shows arg&#8212;unlike display works within try),
<i>read-bit</i> (no arg, reads the next bit of the binary data),
<i>read-exp</i> (no arg, reads the next S-exp from the binary data),
<i>bits</i> (one arg, converts S-exp to bit string of ASCII characters).
</p><p>
[<b>Experimental functions:</b>
<i>was-read</i> (no arg, gives the binary data read so far in the current try),
<i>run-utm-on</i> (one arg, runs a binary program on the universal Turing machine
that's the basis for my computerized version of algorithmic information theory).
These functions are not in the C and Mathematica versions of this interpreter.
For examples of use, click <a href="http://www.cs.auckland.ac.nz/CDMTCS/chaitin/ait/utm2.r">here</a>.
For an explanation, see <a href="http://www.cs.auckland.ac.nz/CDMTCS/chaitin/ait3.html">this chapter</a> of <i>Exploring RANDOMNESS</i>.]

</p></body></html>